package org.endy.leisure.diaTracker.repository

import org.endy.leisure.diaTracker.entity.announcement.Announcement
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.JpaSpecificationExecutor
import org.springframework.stereotype.Repository

@Repository
interface AnnouncementRepository : JpaRepository<Announcement, Long>, JpaSpecificationExecutor<Announcement> {

//    @Query(
//        "select a.id,a.title,a.content,a.publisher,a.create_time as createTime,v.read_status,v.user_id as userId as readTime from announcement a left join announcement_user v on a.id = v.announcement_id where v.user_id = :userId",
//        nativeQuery = true
//    )
//    fun findAnnouncementByUserIdWithStatus(@Param("userId") userId: String): List<Any>

}